using Gateway.Common.Extensions;
using Gateway.Domain.EFCore.Configuration;
using Gateway.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Gateway.Domain.Configuration;

public class UserClientConfiguration : AggregateRootEntityConfiguration<UserClient>
{
    public override void Configure(EntityTypeBuilder<UserClient> builder)
    {
        builder.ToTable(t => t.HasComment("用户client"));
        base.Configure(builder);
        builder.Property(x => x.Account).IsRequired().HasMaxLength(50).HasComment("账号");
        builder.Property(x => x.ConnectionId).IsRequired().HasMaxLength(50).HasComment("链接ID");
    }
}